﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using BotvaBot.Configuration.Personaj;
using BotvaBot.Configuration;

namespace BotvaBot.RichUI
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class MainForm : Window
    {
        public MainForm()
        {
            InitializeComponent();

            MainPageDTO.Value = new MainPageDTO();
            DataContext = MainPageDTO.Value;
        }

        private void Login_Click(object sender, RoutedEventArgs e)
        {
            //var list = new List<int>() { 0, 1, 2, 3, 4, 5, 6, 7, 8, 10 };
            //var list2 = list.Skip(15).Take(100).ToList();


            PersonajCfg personajCfg = lbxPersonajes.SelectedItem as PersonajCfg;

            if (personajCfg == null)
                return;

            PersonajInfo pi = new PersonajInfo(personajCfg);
            pi = pi.GetInfo();

            MainPageDTO.Value.Personaj = new PersonajDTO();
            MainPageDTO.Value.Personaj.Money = pi.Money;
            MainPageDTO.Value.Personaj.Kristaly = pi.Kristaly;
            MainPageDTO.Value.Personaj.Pirashki = pi.Pirashki;
            MainPageDTO.Value.Personaj.Kapusta = pi.Kapusta;
        }
    }
}
